﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 第四次作业
{

    class d2
    {
        static void Main()
        {
            Random rnd = new Random();
            List<int> numbers = Enumerable.Range(0, 100)
                                          .Select(_ => rnd.Next(0, 1001))
                                          .ToList();

            var sortedNumbers = numbers.OrderByDescending(n => n).ToList();
            int sum = sortedNumbers.Sum();
            double average = sortedNumbers.Average();

            Console.WriteLine("排序结果（前10个）: " + string.Join(", ", sortedNumbers.Take(10)));
            Console.WriteLine("总和: " + sum);
            Console.WriteLine("平均数: " + average);
        }
    }
}
